package com.liao.starapp.luck;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import com.liao.starapp.R;

import java.io.Serializable;

public class LuckDetailActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageView img_back;
    private TextView tv_title;
    private TextView tv_zonghe;
    private TextView tv_aiqing;
    private TextView tv_shiye;
    private TextView tv_caifu;
    private TextView tv_jiankang;

    private Luck luck;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_luck_detail);
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
        getWindow().setStatusBarColor(getColor(R.color.actionBarColor));
        luck = (Luck) getIntent().getSerializableExtra("luck");
        initView();
    }

    private void initView() {
        img_back = (ImageView) findViewById(R.id.img_back);
        tv_title = (TextView) findViewById(R.id.tv_title);
        tv_zonghe = (TextView) findViewById(R.id.tv_zonghe);
        tv_aiqing = (TextView) findViewById(R.id.tv_aiqing);
        tv_shiye = (TextView) findViewById(R.id.tv_shiye);
        tv_caifu = (TextView) findViewById(R.id.tv_caifu);
        tv_jiankang = (TextView) findViewById(R.id.tv_jiankang);

        img_back.setOnClickListener(this);

        tv_title.setText(luck.getName());
        tv_zonghe.setText(luck.getZonghe());
        tv_aiqing.setText(luck.getAiqing());
        tv_shiye.setText(luck.getShiye());
        tv_caifu.setText(luck.getCaifu());
        tv_jiankang.setText(luck.getJiankang());
    }

    @Override
    public void onClick(View v) {
        onBackPressed();
        finish();
    }
}
